package org.example;


import java.util.Arrays;

class Parent {
    public static final int num = 10;
    protected int value = 10;

    public Parent(int value) {
        this.value = value;
        System.out.println("Parent constructor with value: " + value);
    }
}

class Child extends Parent {
    protected int value = 20;

    public Child(int value) {
        super(value); // 调用父类构造函数
        System.out.println("Parent value: " + super.value);
        System.out.println(super.num);
        System.out.println("Child constructor");
    }
}


public class Main2 {

    public static void printNumbers(int... numbers) {
        //在方法内部，可变参数被当作数组处理
        System.out.printf("numbers is %s ", (Object) numbers);
        for (int number : numbers) {
            System.out.println(number);
        }
    }

    public static void main(String[] args) {
        // 你可以在这里调用新的 main 方法
        System.out.println("My age is " + 11);

        Child child = new Child(10);

        printNumbers(1, 2, 3, 4);

        int[] array = {1, 2, 3};
        System.out.println(Arrays.toString(array));
    }
}